package com.yi.wood.service.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by moyi on 2019/2/1 17:25
 *
 * @author moyi
 */
public enum OrderPayStatusEnum {
    /**
     * 待支付
     */
    WAIT_PAY(1, "待支付"),
    /**
     * 已支付
     */
    PAYMENT(2, "已支付"),
    /**
     * 退款中
     */
    WAIT_REFUND(3, "退款中"),
    /**
     * 已退款
     */
    REFUNDED(4, "已退款"),
    /**
     * 取消
     */
    CANCEL(5, "取消");


    private Integer status;

    private String msg;

    OrderPayStatusEnum(Integer status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static Map<Integer, String> list() {
        OrderPayStatusEnum[] orderPayStatusEnums = OrderPayStatusEnum.values();
        Map<Integer, String> enumMap = new HashMap<>(orderPayStatusEnums.length, 1);
        for (OrderPayStatusEnum orderPayStatusEnum : orderPayStatusEnums) {
            enumMap.put(orderPayStatusEnum.getStatus(), orderPayStatusEnum.getMsg());
        }
        return enumMap;
    }

}